﻿@using System.Data;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_Layout.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   ViewBag.Title = site.seo_title;
   IndexController c = ViewBag.Controller as IndexController;
}
@section HeaderContent{
   <link href="~/Content/flexslider.css" rel="stylesheet" />
   <script src="~/Scripts/jquery/jquery.flexslider-min.js"></script>
}
@section Scripts{
   <script>
      $(function () {
         $(".focusbox").flexslider({
            directionNav: false,
            pauseOnAction: false
         });
      });
   </script>
}
<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("news")">新闻资讯1<em></em></a>
    </h2>
    <p>
      <!--类别-->
      @{
         int count = 0;
         foreach (DataRow dr in c.get_category_child_list("news", 0).Rows) {
            count ++;
            <a class="@(count == 1 ? "no-bg" : "")" href="@c.linkurl("news_list",dr["id"])">@dr["title"]</a>
         }
      }
      <!--/类别-->
    </p>
  </div>
  <div class="wrapper clearfix">
    <div class="main-left">
      <div class="focusbox">
        <ul class="slides">
           @foreach (DataRow dr in c.get_article_list("news", 0, 8, "status=0 and is_slide=1 and img_url<>''").Rows) {
           <li>
            <a title="@dr["title"]" href="@c.linkurl("news_show",dr["id"])">
              <span class="note-bg"></span>
              <span class="note-txt">@dr["title"]</span>
              <img src="@dr["img_url"]" />
            </a>
          </li>
           }
        </ul>
      </div>
    </div>
    
    <div class="main-left" style="margin-right:0;">
      <ul class="txt-list">
        @{
           count = 0;
           foreach (DataRow dr in c.get_article_list("news", 0, 9, "status=0").Rows) {
            count ++;
            <li class="@(count == 1 ? "tit" : "")">
               @if(count != 1){
               <span>@DateTime.Parse(dr["add_time"].ToString()).ToString("MM-dd")</span>
               }
               <a title="@dr["title"]" href="@c.linkurl("news_show",dr["id"])">@dr["title"]</a>
            </li>
           }
        }
      </ul>
    </div>
    <div class="sidebar-right" style="margin-left:15px;">
      <ul class="img-list ilist">
      @foreach (DataRow dr in c.get_article_list("news", 0, 2, "status=0 and is_top=1 and img_url<>''").Rows) {
        <li>
          <a title="@dr["title"]" href="@c.linkurl("news_show",dr["id"])">
             @if(dr["is_top"].ToString() == "1"){
               <span class="abs-txt">头条</span>
             }
            <span class="abs-bg"></span>
            <span class="txt1">@dr["title"]</span>
            <span class="txt2">
              <i>@DateTime.Parse(dr["add_time"].ToString()).ToString("mm-dd")</i>
              <p>@dr["zhaiyao"]</p>
            </span>
            <img src="@dr["img_url"]" />
          </a>
        </li>
       }
      </ul>
    </div>
  </div>
</div>

<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("goods")">购物商城<em></em></a>
    </h2>
    <p>
      <!--类别-->
      @{
         count = 0;
         foreach (DataRow dr in c.get_category_child_list("goods", 0).Rows) {
            count++;
            <a class="@(count == 1 ? "no-bg" : "")" href="@c.linkurl("goods_list",dr["id"])">@dr["title"]</a>
         }
      }
      <!--/类别-->
    </p>
  </div>
  <div class="wrapper clearfix">
    <div class="main-left ilist">
   @foreach (DataRow dr in c.get_article_list("goods", 0, 1, "status=0 and is_slide=1").Rows) {
      <a title="@dr["title"]" href="@c.linkurl("goods_show",dr["id"])">
        <span class="abs-bg"></span>
        <span class="txt1">@dr["title"]</span>
        <span class="txt2">
          <p>@dr["sub_title"]</p>
        </span>
        <img src="@dr["img_url"]" />
      </a>
   }
    </div>
    <div class="main-right">
      <ul class="img-list ilist">
        @foreach (DataRow dr in c.get_article_list("goods", 0, 6, "status=0 and is_red=1").Rows) {
         <li>
          <a title="@dr["title"]" href="@c.linkurl("goods_show",dr["id"])">
            @if(dr["is_top"] =="1"){
            <span class="abs-txt">特价</span>
            }
            <span class="abs-bg"></span>
            <span class="price">
              <i>¥@dr["market_price"]</i>
              <b>¥</b>@dr["sell_price"]
            </span>
            <span class="protxt">@dr["title"]</span>
            <img src="@dr["img_url"]" />
          </a>
        </li>
        }
      </ul>
    </div>
  </div>
</div>

<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("video")">视频专区<em></em></a>
    </h2>
    <p>
      <!--类别-->
       @{
          count = 0;
          foreach (DataRow dr in c.get_category_child_list("video", 0).Rows) {
             count++;
             <a class="@(count == 1 ? "no-bg" : "")" href="@c.linkurl("video_list",dr["id"])">@dr["title"]</a>
          }
       }
      <!--/类别-->
    </p>
  </div>
  <div class="wrapper clearfix">
    <div class="main-left ilist">
      @foreach (DataRow dr in c.get_article_list("video", 0, 1, "status=0 and is_slide=1").Rows) {
      <a title="@dr["title"]" href="@c.linkurl("video_show",dr["id"])">
        <em></em>
        <span class="abs-bg"></span>
        <span class="txt1">@dr["title"]</span>
        <span class="txt2">
          <p>@dr["sub_title"]</p>
        </span>
        <img src="@dr["img_url"]" />
      </a>
      }
    </div>
    <div class="main-right">
      <ul class="img-list ilist">
      @foreach (DataRow dr in c.get_article_list("video", 0, 6, "status=0 and is_red=1").Rows) {
        <li>
          <a title="@dr["title"]" href="@c.linkurl("video_show",dr["id"])">
            <em></em>
            <span class="abs-bg"></span>
            <span class="txt1">@dr["title"]</span>
            <span class="txt2">
              <p>@dr["sub_title"]</p>
            </span>
            <img src="@dr["img_url"]" />
          </a>
        </li>
      }
      </ul>
    </div>
  </div>
</div>

<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("photo")">图片分享<em></em></a>
    </h2>
    <p>
      <!--类别-->
   @{
      count = 0;
      foreach (DataRow dr in c.get_category_child_list("photo", 0).Rows) {
         count++;
         <a class="@(count == 1 ? "no-bg" : "")" href="@c.linkurl("photo_list",dr["id"])">@dr["title"]</a>
      }
   }
      <!--/类别-->
    </p>
  </div>
  <div class="wrapper clearfix">
    <div class="photo-list ilist">
      <ul>
@{
   count = 0;
   foreach (DataRow dr in c.get_article_list("photo", 0, 6, "status=0 and is_red=1").Rows) {
      count++;
        <li class="col-@count">
          <a title="@dr["title"]" href="@c.linkurl("photo_show",dr["id"])">
            <span class="abs-bg"></span>
            <span class="txt1">@dr["title"]</span>
            <span class="txt2">
              <p>@dr["add_time"]</p>
            </span>
            <img src="@dr["img_url"]" />
          </a>
        </li>
   }
}
      </ul>
    </div>
  </div>
</div>

<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("down")">资源下载<em></em></a>
    </h2>
    <p>
      <!--类别-->
@{
   count = 0;
   foreach (DataRow dr in c.get_category_child_list("down", 0).Rows) {
      count++;
      <a class="@(count == 1 ? "no-bg" : "")" href="@c.linkurl("down_list",dr["id"])">@dr["title"]</a>
   }
}
      <!--/类别-->
    </p>
  </div>
  <div class="wrapper clearfix">
    <ul class="img-list high ilist">
      @foreach (DataRow dr in c.get_article_list("down", 0, 5, "status=0 and is_red=1").Rows) {
      <li>
        <a title="@dr["title"]" href="@c.linkurl("down_show",dr["id"])">
          <div class="img-box">
            <img src="@dr["img_url"]" />
          </div>
          <div class="info">
            <h3>@dr["title"]</h3>
            <span>
              <i>下载：<script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_attach_count&id=@dr["id"]&view=count"></script>次</i>
              <p>@DateTime.Parse(dr["add_time"].ToString()).ToString("yyyy-MM-dd")</p>
            </span>
          </div>
        </a>
      </li>
      }
    </ul>
  </div>
</div>

<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@c.linkurl("link")">友情链接<em></em></a>
    </h2>
    <p>
      <a class="no-bg" href="@c.linkurl("link")">申请链接</a>
    </p>
  </div>
  <div class="wrapper link-box">
    <div class="txt">
      @foreach (DataRow dr in new LinkController().get_link_list(0, "is_lock=0 and is_image=0 and is_red=1").Rows) {
        <a target="_blank" href="@dr["site_url"]">@dr["title"]</a> @:|
      }
    </div>
    <ul class="img">
      @foreach (DataRow dr in new LinkController().get_link_list(10, "is_lock=0 and is_image=1 and is_red=1").Rows) {
        <li><a target="_blank" href="@dr["site_url"]" title="@dr["title"]"><img src="@dr["img_url"]" /></a></li>
      }
    </ul>
  </div>
</div>
